package com.xxg.fileshand.base

import android.os.Bundle
import android.view.WindowManager
import androidx.viewbinding.ViewBinding
import com.dylanc.viewbinding.inflateBindingWithGeneric
import com.gyf.immersionbar.ImmersionBar

/**
 * Create by Sxl on 2021/12/22.
 */
abstract class BaseVBActivity<V : ViewBinding> : BaseActivity() {

    lateinit var mBinding: V

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)

        mBinding = inflateBindingWithGeneric(layoutInflater)
        setContentView(mBinding.root)

        ImmersionBar.with(this)
            .transparentStatusBar()
            .fitsSystemWindows(false).init()
    }

    override fun finish() {
        hideSoftKeyboard()
        super.finish()
    }

}